<Grid xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="200" Height="300" Background="Black">
  <Grid.Resources>
    <Style x:Key="ClearLink" TargetType="HyperlinkButton">
      <Setter Property="Foreground" Value="#FF73A9D8"/>
      <Setter Property="Padding" Value="0"/>
      <Setter Property="Cursor" Value="Hand"/>
      <Setter Property="HorizontalContentAlignment" Value="Left"/>
      <Setter Property="VerticalContentAlignment" Value="Top"/>
      <Setter Property="Background" Value="Transparent"/>
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="HyperlinkButton">
            <Grid Cursor="{TemplateBinding Cursor}" Background="{TemplateBinding Background}">
              <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                  <VisualState x:Name="Normal"/>
                  <VisualState x:Name="MouseOver">
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="UnderlineTextBlock" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0">
                          <DiscreteObjectKeyFrame.Value>
                            <Visibility>Visible</Visibility>
                          </DiscreteObjectKeyFrame.Value>
                        </DiscreteObjectKeyFrame>
                      </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualState>
                  <VisualState x:Name="Pressed">
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="UnderlineTextBlock" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0">
                          <DiscreteObjectKeyFrame.Value>
                            <Visibility>Visible</Visibility>
                          </DiscreteObjectKeyFrame.Value>
                        </DiscreteObjectKeyFrame>
                      </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualState>
                  <VisualState x:Name="Disabled">
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledOverlay" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0">
                          <DiscreteObjectKeyFrame.Value>
                            <Visibility>Visible</Visibility>
                          </DiscreteObjectKeyFrame.Value>
                        </DiscreteObjectKeyFrame>
                      </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                  <VisualState x:Name="Focused">
                    <Storyboard/>
                  </VisualState>
                  <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
              </VisualStateManager.VisualStateGroups>
              <TextBlock HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="UnderlineTextBlock" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed" Text="{TemplateBinding Content}" TextDecorations="Underline"/>
              <TextBlock HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="DisabledOverlay" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed" Foreground="#FFAAAAAA" Text="{TemplateBinding Content}" Canvas.ZIndex="1"/>
              <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
            </Grid>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <LinearGradientBrush x:Key="ButtonFill" EndPoint="0.5,1" StartPoint="0.5,0">
      <GradientStop Color="#FF222222"/>
      <GradientStop Color="#FF626262" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ButtonStroke" EndPoint="0.5,1" StartPoint="0.5,0">
      <GradientStop Color="#FF848484"/>
      <GradientStop Color="#FF000000" Offset="1"/>
    </LinearGradientBrush>
    <Style x:Key="DetailText" TargetType="TextBlock">
      <Setter Property="FontSize" Value="10" />
    </Style>
  </Grid.Resources>
  <Grid x:Name="LayoutRoot">
    <Grid Margin="8">
      <Grid.RowDefinitions>
        <RowDefinition Height="32" />
        <RowDefinition Height="21" />
        <RowDefinition Height="*" />
        <RowDefinition Height="13" />
      </Grid.RowDefinitions>
      <Canvas>
        <Rectangle x:Name="AvatarOutline" Width="34" Height="34" Fill="#CCC" />
        <Image x:Name="tileUrl" Width="32" Height="32" Margin="1,1" Source="{Binding TileUrl}" />
        <Canvas x:Name="LinkPanel" Height="16.625" Width="32.75" Canvas.Left="0.5" Canvas.Top="17" Opacity="0">
          <HyperlinkButton x:Name="profileUrl" NavigateUri="{Binding ProfileUrl}" Style="{StaticResource ClearLink}">
            <ToolTipService.ToolTip>
              <TextBlock Text="View Profile"/>
            </ToolTipService.ToolTip>
            <Canvas Height="16.625" Width="16">
              <Rectangle Height="16" Width="16" RadiusX="2" RadiusY="2" StrokeThickness="1" Fill="{StaticResource ButtonFill}" Stroke="{StaticResource ButtonStroke}"/>
              <Path Height="7.093" Width="12.173" Canvas.Left="2.253" Canvas.Top="8.4" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FF000000" Data="M3.7906218,8.5013294 L2.114038,14.385026 L13.293092,14.106149 L12.174877,8.2892933 z" StrokeThickness="0.5"/>
              <Path Height="6.871" Width="8.1" Canvas.Left="4.277" Canvas.Top="8.467" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FF000000" Data="M3.7905028,14.385477 L4.0959969,8.5200243 L10.70595,8.5108204 L10.907887,14.38595 z" StrokeThickness="0.5"/>
              <Ellipse Height="6.705" Width="6.633" Canvas.Left="5.001" Canvas.Top="2.167" Fill="#FFFFFFFF" Stroke="#FF000000" StrokeThickness="0.5"/>
            </Canvas>
          </HyperlinkButton>
          <HyperlinkButton x:Name="messageUrl" Canvas.Left="16.75" NavigateUri="{Binding MessageUrl}" Style="{StaticResource ClearLink}">
            <ToolTipService.ToolTip>
              <TextBlock Text="Send Message"/>
            </ToolTipService.ToolTip>
            <Canvas Height="16.625" Width="16">
              <Rectangle Height="16" Width="16" RadiusX="2" RadiusY="2" StrokeThickness="1" Fill="{StaticResource ButtonFill}" Stroke="{StaticResource ButtonStroke}" />
              <Rectangle Height="8" Width="11.5" Canvas.Left="2.417" Canvas.Top="4.667" Fill="#FFFFFFFF" Stroke="#FF000000" StrokeThickness="0.5" RadiusX="0" RadiusY="1"/>
              <Path Height="5.333" Width="11.5" Canvas.Left="2.667" Canvas.Top="7.166" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FF000000" StrokeThickness="0.5" Data="M2.7500019,11.833333 L7.5833316,7.1669993 L13.750748,12.000341 z"/>
              <Path Height="4.833" Width="11" Canvas.Left="2.834" Canvas.Top="5.25" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FF000000" StrokeThickness="0.5" Data="M2.9166687,5.5 L7.7496634,9.8333311 L13.416317,5.4999981 z"/>
            </Canvas>
          </HyperlinkButton>
        </Canvas>
      </Canvas>

      <HyperlinkButton Margin="36,1,0,0" x:Name="profileUrl2" NavigateUri="{Binding ProfileUrl}" Style="{StaticResource ClearLink}">
        <ToolTipService.ToolTip>
          <TextBlock Text="View Profile"/>
        </ToolTipService.ToolTip>
        <TextBlock x:Name="GamerTagText" Text="{Binding GamerTag}" Style="{StaticResource DetailText}" FontSize="12" FontWeight="Bold" />
      </HyperlinkButton>

      <!-- Gamerscore -->
      <StackPanel Margin="38,17,0,0" Orientation="Horizontal">
        <TextBlock x:Name="GamerScoreText" Text="{Binding GamerScore}" Style="{StaticResource DetailText}" />
        <Canvas Margin="3,1,0,0">
          <Ellipse x:Name="GamerScoreBackground" Fill="#CCC" Height="12" Width="12" HorizontalAlignment="Left"/>
          <TextBlock x:Name="GamerSymbol" Canvas.Top="-1" Canvas.Left="2" Text="G" Style="{StaticResource DetailText}" Foreground="#f7f2f0" />
        </Canvas>
      </StackPanel>

      <TextBlock x:Name="InfoText" Text="{Binding PresenceInfo.FullInfo}" Margin="1,2,0,0" Grid.Row="1" Style="{StaticResource DetailText}" Width="184" />
      <!-- Recent Games -->
      <Canvas Grid.Row="2" Margin="-4,0,0,0" x:Name="gameContainer" />
      <TextBlock x:Name="LinkBack" Grid.Row="3" Text="" Style="{StaticResource DetailText}" />
    </Grid>

    <!-- Status Indicator -->
    <Image x:Name="OnlineImage" Grid.RowSpan="4" Stretch="None" Visibility="Collapsed" HorizontalAlignment="Right" VerticalAlignment="Top">
      <ToolTipService.ToolTip>
        <TextBlock Text="Online" />
      </ToolTipService.ToolTip>
    </Image>
    <Image x:Name="OfflineImage" Grid.RowSpan="4" Stretch="None" Visibility="Collapsed" HorizontalAlignment="Right" VerticalAlignment="Top">
      <ToolTipService.ToolTip>
        <TextBlock Text="Offline" />
      </ToolTipService.ToolTip>
    </Image>

  </Grid>
</Grid>
